package com.test.model.facade;

public class FacadePatternDemo {
    public static void main(String[] args) {
        // 创建子系统实例
        AudioPlayer mp3Player = new MP3Player();
        AudioPlayer cdPlayer = new CDPlayer();
        AudioRecorder recorder = new Recorder();

        // 创建外观类实例
        AudioSystemFacade facade = new AudioSystemFacade(mp3Player, recorder);

        // 使用外观类
        facade.startPlayingAudio(); // 输出: MP3 Player is playing audio.
        facade.stopPlayingAudio();  // 输出: MP3 Player has stopped playing audio.

        facade.startRecordingAudio(); // 输出: com.test.model.facade.Recorder is recording audio.
        facade.stopRecordingAudio();  // 输出: com.test.model.facade.Recorder has stopped recording audio.
    }
}
